package com.ccb.sc.common.modules.shopkeeper.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @version 1.0
 * @date 2020-09-25
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum FeedbackType implements IEnum<Integer> {

    /**
     * 反馈类型 0CEO信箱 1功能异常 2其他异常 3功能意见 4售后意见 5其他意见 6乱价 7私换团队
     */
    CEO_MAILBOX(0, "CEO信箱"),

    FUNCTION_ERROR(1, "功能异常"),

    OTHER_ERROR(2, "其他异常"),

    FUNCTION_SUGGESTION(3, "功能意见"),

    AFTER_SALES_SUGGESTION(4, "售后意见"),

    OTHER_SUGGESTION(5, "其他意见"),

    DISORDERLY_PRICE(6, "乱价"),

    PRIVATE_EXCHANGE_TEAM(7, "私换团队"),
    ;

    private final int value;
    private final String desc;

    FeedbackType(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static FeedbackType getByValue(int value) {
        for (FeedbackType orderStatus : FeedbackType.values()) {
            if (value == orderStatus.getValue()) {
                return orderStatus;
            }
        }
        return null;
    }
}
